import asyncio
from utils.uow import UnitOfWork
from utils.funcs import get_current_date

HOUR_RESET_GOLD = 16


async def reset_gold() -> None:
    while True:
        if get_current_date().hour == HOUR_RESET_GOLD:
            async with UnitOfWork() as uow:
                await uow.regions.reset_gold()

        await asyncio.sleep(60 * 60)  # hour
